import { defHttp as request } from '/@/utils/http/axios'

export const getRoleList = (p) => {
    return request.post({
        url: '/role/page',
        data: p
    });
};
export const addRole = (p) => {
    return request.post({
        url: '/role/addRole',
        data: p
    });
};
export const deleteRole = (p) => {
    return request.post({
        url: '/role/deleteRole',
        data: p
    });
};
export const updateRole = (p) => {
    return request.post({
        url: '/role/updateRole',
        data: p
    });
};
export const getMenuList = (p) => {
    return request.post({
        url: '/core/client/queryAllMenuByClients',
        data: p
    });
};
export const getAuthMenuIds = (p) => {
    return request.post({
        url: '/role/queryRoleMenu',
        data: p
    });
};
export const grantRoleMenu = (p) => {
    return request.post({
        url: '/role/grantMenu',
        data: p
    });
};

export const getRoleBindedUser = (p) => {
    return request.post({
        url: '/role/queryUserByRole',
        data: p
    });
};
export const getRoleUnbindedUser = (p) => {
    return request.post({
        url: '/role/queryNotUserByRole',
        data: p
    });
};
export const addRoleBindedUser = (p) => {
    return request.post({
        url: '/role/grantUser',
        data: p
    });
};
export const delRoleBindedUser = (p) => {
    return request.post({
        url: '/role/revokeUser',
        data: p
    });
};
export const updateRoleResource = (p) => {
    return request.post({
        url: '/core/clientManagerRelation/grantRoleByClientManager',
        data: p
    });
};